package ch.pizzapp.kurier;

import android.app.DialogFragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

public class LoginDialogFragment extends DialogFragment {

	private static final String ARG_SHOW_AS_DIALOG = "DetailedFragment.ARG_SHOW_AS_DIALOG";

	public static LoginDialogFragment newInstance(boolean showAsDialog) {
		LoginDialogFragment fragment = new LoginDialogFragment();
		Bundle args = new Bundle();
		args.putBoolean(ARG_SHOW_AS_DIALOG, showAsDialog);
		fragment.setArguments(args);
		return fragment;
	}

	public static LoginDialogFragment newInstance() {
		return newInstance(true);
	}

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		Bundle args = getArguments();
		if (args != null) {
			setShowsDialog(args.getBoolean(ARG_SHOW_AS_DIALOG, true));
		}
	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		return inflater.inflate(R.layout.activity_login_fragment, container,
				false);
	}
}